RELEASE_TAR := mpwm-$(shell date +%F).tar.gz

CC=g++ 
CPPFLAGS=-g -Wall
# Cudd Directory
CUDD	= ../../cudd-2.4.2/
CUDDLIBS = $(CUDD)obj/cuddObj.o $(CUDD)obj/libobj.a \
	$(CUDD)cudd/libcudd.a $(CUDD)mtr/libmtr.a $(CUDD)st/libst.a \
	$(CUDD)util/libutil.a $(CUDD)epd/libepd.a
INCLUDE=-Iinclude -I$(CUDD)include 
SRC=src/
LIB=include/
OBJECTS=$(SRC)utilities.o $(SRC)formula.o

default: prtest

formula.o: $(SRC)formula.cc $(LIB)formula.hh
	$(CC) $(CPPFLAGS) $(INCLUDE) -c $(SRC)formula.cc  -o $(SRC)formula.o

utilities.o: $(SRC)utilities.cc $(LIB)utilities.hh
	$(CC) $(CPPFLAGS) $(INCLUDE) -c $(SRC)utilities.cc  -o $(SRC)utilities.o

prtest: utilities.o formula.o
	$(CC) $(CPPFLAGS) $(INCLUDE) $(CUDDLIBS) $(OBJECTS) -o prtest $(SRC)prtest.cc 

deepmodel: utilities.o formula.o
	$(CC) $(CPPFLAGS) $(INCLUDE) $(CUDDLIBS) $(OBJECTS) -o deepmodel $(SRC)deepmodel.cc 

widemodel: utilities.o formula.o
	$(CC) $(CPPFLAGS) $(INCLUDE) $(CUDDLIBS) $(OBJECTS) -o widemodel $(SRC)widemodel.cc 

testcudd.o: $(SRC)testcudd.cc
	$(CC) $(CPPFLAGS) $(INCLUDE) -c $(SRC)testcudd.cc -o testcudd.o

testcudd: testcudd.o utilities.o
	$(CC) $(CPPFLAGS) $(INCLUDE) $(CUDDLIBS) -o testcudd $(SRC)testcudd.cc 

clean:
	rm -f widemodel deepmodel prtest testcudd.o testcudd $(OBJECTS)

